﻿using System;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Windows.Data;
using FFmpegVideoClip.Lib.AdvancedFragmentProcessor;

namespace FFmpegVideoClip.Lib.UtilityControlsTools
{
    //锁死列表首个输入选择到输入文件 而不是流程输出的结果
    [ValueConversion(typeof(object[]), typeof(bool))]
    public class PSignInParentCollectionToIndexConvert : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            AdvancedParametersSchemeModule ps = (AdvancedParametersSchemeModule)values[0];
            Collection<AdvancedParametersSchemeModule> list = (Collection<AdvancedParametersSchemeModule>)values[1];
            if (ps is null || list is null)
                return false;
            return list.IndexOf(ps) < 1;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
